package restlet;

import org.restlet.Restlet;
import org.restlet.Server;
import org.restlet.data.MediaType;
import org.restlet.data.Protocol;
import org.restlet.Request;
import org.restlet.Response;

public class Restlet_helloworld {
	public static void main(String[] args) throws Exception {
		// Creating a minimal Restlet returning "Hello World“
		Restlet restlet = new Restlet() {
			@Override
			public void handle(Request request, Response response) {
				response.setEntity("Hello World!", MediaType.TEXT_PLAIN);
			}
		};

		// Create the HTTP server and listen on port 8182
		new Server(Protocol.HTTP, 8182, restlet).start();
	}
}